<template>
<div>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item :to="{ path: '/home' }">库存首页</el-breadcrumb-item>
    <el-breadcrumb-item>库存列表</el-breadcrumb-item>
  </el-breadcrumb>
  <el-card>
    <el-row :gutter="20">
    <el-col :span="12">
      <el-button type="primary" @click="inboundDialog=true">入库</el-button>
      <el-button type="primary" @click="addDialogVisible = true">批量出库</el-button>
      <el-button type="primary" @click="addDialogVisible = true">扫码出库</el-button>
      <el-button type="primary" @click="addDialogVisible = true">打印条码</el-button>
    </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%" border stripe>
      <el-table-column type="index"></el-table-column>
      <el-table-column type="selection"></el-table-column>
      <el-table-column
        prop="in_sn"
        label="批号"
        width="180">
      </el-table-column>
      <el-table-column label="物品类型">
        <template slot-scope="scope"><pre>{{scope.row.bigCate.name}}</pre></template>
      </el-table-column>
      <el-table-column label="规格型号">
        <template slot-scope="scope">{{scope.row.smallCate.name}}</template>
      </el-table-column>
      <el-table-column label="有效期限" prop="validity"></el-table-column>
      <el-table-column label="供应商" prop="supplier"></el-table-column>
      <el-table-column label="生产厂家" prop="oem"></el-table-column>
      <el-table-column label="采购人" prop="buyer"></el-table-column>
      <el-table-column label="总数量" prop="amount"></el-table-column>
      <el-table-column label="二级分类物品"></el-table-column>
      <el-table-column label="质检状态"></el-table-column>
      <el-table-column label="物品状态"></el-table-column>
      <el-table-column label="操作">
      </el-table-column>
    </el-table>
  </el-card>
  <inbound :dialogVisible="inboundDialog"></inbound>
</div>
</template>

<script>
import Inbound from '@/components/list/InboundDialog'
export default {
  components: {
    Inbound,
  },
  created() {
    this.getList()
  },
  data() {
    return {
      queryInfo: {
        current_page: 1,
        pagesize: 10
      },
      tableData: [],
      inboundDialog: false,
    }
  },
  methods: {
    async getList() {
      const { data: res } = await this.$http.get('inboundList', {
        params: this.queryInfo
      })
      if (res.meta.status !== 200) {
        return this.$message.error('获取列表失败！')
      }
      this.tableData = res.data.data
      this.total = res.data.total
      this.inboundDialog=false
    }
  }
};
</script>

<style scoped>

</style>
